<?php

namespace App\Api;

use App\Repository\Order\OrderRepository;

class ChannelApi
{
    public function __construct()
    {
    }

    public function getAgreement($data = array())
    {
        return $this->returnMsg(200, '查询成功');
    }

    public function selectNumber($data = array())
    {
        $array = [
            'city' => '', // 所在城市
            'iccid' => '', // 号码
        ];
        return $this->returnMsg(100, '未查询到号码', []);
    }

    public function selectNumberTwo($data = array())
    {
        $array = [
            'city' => '', // 所在城市
            'iccid' => '', // 号码
        ];
        return $this->returnMsg(100, '未查询到号码01', []);
    }

    public function orderSubmit($data)
    {
        return $this->returnMsg(200, '下单成功');
    }

    public function checkOrder($data)
    {
        return $this->returnMsg(200, '效验成功');
    }

    public function returnMsg($code = 200, $msg = '操作成功', $data = [])
    {
        return [
            'code' => $code,
            'msg' => $msg,
            'data' => $data
        ];
    }

    public function queryOneOrder($data = array())
    {
        return $this->returnMsg(200, '查询成功', []);
    }

    public function editOrderStatus($data)
    {
        $model = new OrderRepository();
        $return = $model->editOrderStatus($data);
        return $return;
    }
}
